﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="ES_TrainingRequest.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.ES_TrainingRequest" %>
<%@ Register src="../Controls/user.ascx" tagname="user" tagprefix="uc1" %>

<asp:Content ID="Content1" runat="server" contentplaceholderid="ContentPlaceHolder1">  

  <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" />
        
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">        
            <script type="text/javascript">
                function onTextChange(sender) 
                {
                    if (sender.get_value() == "") 
                    { sender.set_text("");}
                }            
                function openDetails(trainee_seq)
                {
                   radopen("ES_TrainingRequestApp.aspx?Sequence=" + trainee_seq,"RadWindow1");
                }
            </script>    
    </telerik:RadCodeBlock>
      
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Panel6">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel6" 
                        LoadingPanelID="RadAjaxLoadingPanel2" /> 
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

       <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server">
    </telerik:RadAjaxLoadingPanel>    
    
    <asp:panel ID="Panel6" runat="server" >
    <table width="1000" cellpadding="0" cellspacing="0">
        <tr>
        <td colspan = "3">
        <div class="moduleDivSlim1000x450">
        <div class="moduleDivBottom1000">
        <table align="center" width ="980px" >
        <tr>
            <td align="left" class="tableHeader">
                รายการสมัครเข้ารับการอบรม </td>
        </tr>
        </table>
        <table width ="980px" align="center">
        <tr>
        <td align="left">
        <asp:Panel ID="PanelGrid" 
            runat="server" 
            Height="380px" 
            ScrollBars="Auto" 
            Visible="true" 
            Width="969px">
                <telerik:RadGrid ID="RadGrid2" 
                    runat="server" 
                    AllowAutomaticDeletes="True" 
                    AllowFilteringByColumn="True" 
                    AllowMultiRowEdit="True" 
                    AllowMultiRowSelection="True" 
                    AllowPaging="True" 
                    AllowSorting="True" 
                    AutoGenerateColumns="False" 
                    EnableAJAX="True" 
                    EnableAJAXLoadingTemplate="True" 
                    GridLines="None" 
                    Height="360px" 
                    OnItemCommand="RadGrid2_ItemCommand" 
                    Skin="Outlook" 
                    Width="960px">
                    <MasterTableView 
                        AllowMultiColumnSorting="True" 
                        CellSpacing="-1" 
                        ClientDataKeyNames="train_seq" 
                        CommandItemDisplay="Top" 
                        DataKeyNames="train_seq" 
                        NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                        <CommandItemTemplate>
                            <table width="99%">
                                <tr>
                                    <td align="left">
                                       <asp:LinkButton ID="AddInstitute" 
                                            runat="server" 
                                            CommandName="AddData" 
                                            Visible="true">
                                            <img alt="" src="../Images/Buttons/AddRecord.gif" 
                                                style="border:0px;vertical-align:middle;" /> เพิ่มรายการใหม่
                                        </asp:LinkButton>
                                    </td>
                                    <td align="right">
                                    
                                    </td>
                                </tr>
                                <tr><td></td></tr>
                            </table>
                        </CommandItemTemplate>
                        <Columns>
                                        
                            <telerik:GridBoundColumn 
                                DataField="train_seq" 
                                UniqueName="train_seq" 
                                Visible="false">
                            </telerik:GridBoundColumn>
                            
                            <telerik:GridTemplateColumn 
                               AutoPostBackOnFilter="true" 
                                CurrentFilterFunction="Contains" 
                                DataField="training_course_descr" 
                                FilterControlWidth="100%" 
                                HeaderText="หลักสูตรการอบรม" 
                                ShowFilterIcon="false" 
                                UniqueName="training_course_descr">          
                                <ItemTemplate>              
                                    <asp:LinkButton ID="cmDetail" runat="server" ToolTip="สมัครเข้ารับการอบรม"
                                        Text='<%# Eval("training_course_descr") %>' 
                                        OnClientClick='<%# string.Format("return openDetails(\"{0}\");", Eval("train_seq")) %>'>
                                    </asp:LinkButton>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" Wrap="False" />               
                            </telerik:GridTemplateColumn>                               
                             <%--<telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                CurrentFilterFunction="Contains" DataField="training_course_descr" 
                                FilterControlWidth="100%" HeaderText="รายละเอียดการอบรม" ShowFilterIcon="false" 
                                UniqueName="training_course_descr" Visible="true">
                                <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                            </telerik:GridBoundColumn>--%>
                            
                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                CurrentFilterFunction="Contains" 
                                DataFormatString="{0:d}" 
                                DataField="created_when" 
                                FilterControlWidth="100%" HeaderText="วันที่สมัคร" ShowFilterIcon="false" 
                                UniqueName="created_when" >
                                <HeaderStyle HorizontalAlign="Center" Wrap="False" Width="80px"/>
                            </telerik:GridBoundColumn> 
                            
                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                CurrentFilterFunction="Contains" DataField="date_training_start" 
                                FilterControlWidth="100%" HeaderText="วันที่อบรม" 
                                ShowFilterIcon="false"
                                DataFormatString="{0:d}"  
                                UniqueName="date_training_start">
                                <HeaderStyle HorizontalAlign="Center" Width="80px" Wrap="False" />
                            </telerik:GridBoundColumn>
                            
                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                CurrentFilterFunction="Contains" DataField="Approve" 
                                FilterControlWidth="100%" HeaderText="ผลการพิจารณา" ShowFilterIcon="false" 
                                UniqueName="Approve">
                                <HeaderStyle HorizontalAlign="Center" Wrap="False" Width="80px"/>
                            </telerik:GridBoundColumn>
                            
                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                CurrentFilterFunction="Contains" DataField="T_SCORE" 
                                FilterControlWidth="100%" HeaderText="ผลการอบรม" ShowFilterIcon="false" 
                                UniqueName="T_SCORE">
                                <HeaderStyle HorizontalAlign="Center" Wrap="False" Width="80px"/>
                            </telerik:GridBoundColumn>
                            
                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                CurrentFilterFunction="Contains" 
                                DataFormatString="{0:d}" 
                                DataField="date_training_end" 
                                FilterControlWidth="100%" HeaderText="อบรมถึงวันที่" ShowFilterIcon="false" 
                                UniqueName="date_training_end" 
                                 Visible="false">
                                <HeaderStyle HorizontalAlign="Center" Wrap="False" Width="80px"/>
                            </telerik:GridBoundColumn> 
                            
                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                CurrentFilterFunction="Contains" DataField="Status" FilterControlWidth="100%" 
                                HeaderText="สถานะ" ShowFilterIcon="false" UniqueName="Status" Visible="True">
                                <HeaderStyle HorizontalAlign="Center" Width="50px" Wrap="False" />
                            </telerik:GridBoundColumn>  
                           
                        </Columns>                        
                    <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                </MasterTableView>
                    <ClientSettings AllowColumnHide="True" 
                        AllowColumnsReorder="True" 
                        EnableRowHoverStyle="True" 
                        ReorderColumnsOnClient="True">
                        <Scrolling AllowScroll="true" UseStaticHeaders="True" />
                        <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />
                    </ClientSettings>
            </telerik:RadGrid>
        </asp:Panel>
        <asp:Panel ID="PanelAddData2" 
            runat="server"
            Height="380px"
            Visible="false" 
            width="956px" 
            align="center">
                            <ul class="formList890px">
                            <li>
                                <table align="left" width="900px"> 
                                    <tr>
                                    <td align ="right" valign ="top" style="width:25%" >
                                        หลักสูตรอบรม :
                                    </td>
                                    <td align="left" colspan="2">
                                        <telerik:RadComboBox 
                                            runat="server" 
                                            ID="cbTrainingCur" 
                                            AllowCustomText ="true" 
                                            DataTextField="training_course_descr" 
                                            DataValueField="train_seq" 
                                            Filter ="Contains"
                                            CausesValidation ="false"
                                            OnClientTextChange = "onTextChange" 
                                            AutoPostBack="true"
                                            Onselectedindexchanged="cbTrainingCur_SelectedIndexChanged"                                           
                                            EmptyMessage = "...เลือกหลักสูตรอบรม..."
                                            Width="400px" >
                                        </telerik:RadComboBox>
                                        <span class="validate">*</span>
                                        <asp:RequiredFieldValidator runat="server" 
                                            ID="RequiredFieldValidator1" 
                                            ControlToValidate="cbTrainingCur"
                                            ErrorMessage="กรุณากรอกข้อมูลหลักสูตรอบรม" >
                                        </asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                </table>
                            </li>                                
                            <li>
                            <table align="left" width="900px">
                            <tr>
                               <td align="right" style="width:25%">
                                    เปิดรับสมัครตั้งแต่วันที่ :
                                </td>
                                
                                <td align="left" style="width: 130px">
                                    <asp:Label ID="lbDateSignStard" runat="server" ForeColor="Blue"></asp:Label>
                                </td>
                                    
                                <td align="right" style="width: 40px">
                                    ถึง
                                </td> 
                                <td align="left">
                                    <asp:Label ID="lbDateSignEnd" runat="server" ForeColor="Blue"></asp:Label>
                                </td>
                            </tr>
                            </table>
                            </li>
                            <li>
                            <table align="left" width="900px">
                            <tr>
                               <td align="right" style="width:25%">
                                    อบรมตั้งแต่วันที่ :
                                </td>
                                
                                <td align="left" style="width: 130px">
                                    <asp:Label ID="lbDateTrainStard" runat="server" ForeColor="Blue"></asp:Label>
                                </td>
                                    
                                <td align="right" style="width: 40px">
                                    ถึง
                                </td> 
                                <td align="left">
                                    <asp:Label ID="lbDateTrainEnd" runat="server" ForeColor="Blue"></asp:Label>
                                </td>
                            </tr>
                            </table>
                            </li>                                                                    
                                           
                            <li>
                             <table align="left" width="900px"> 
                                <tr>
                                   <td align="right" style="width:25%">
                                    จำนวนผู้เข้ารับการอบรมที่รองรับได้สูงสุด :</td>
                                
                                <td align="left">
                                    <asp:Label ID="lbMaxTrainee" runat="server" ForeColor="Blue"></asp:Label>&#160;&#160;คน</td>
                                </tr>
                                </table>
                            </li>
                            <li>
                             <table align="left" width="900px" > 
                                <tr>
                                   <td align="right" style="width:25%">
                                            จำนวนคนในQuota :</td>
                                        
                                        <td align="left">
                                            <asp:Label ID="lbQuota" runat="server" ForeColor="Blue"></asp:Label>&#160;&#160;คน
                                        </td>
                                   </tr>
                                </table>
                            </li>
                            <li>
                             <table align="left" width="900px" visible="false"> 
                                <tr>
                                   <td align="right" style="width:25%">
                                        จำนวนผู้สมัคร :
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="lbTotalTrainee" runat="server" ForeColor="Blue"></asp:Label>&#160;&#160;คน
                                    </td>
                                </tr>
                                    
                                </table>
                            </li>
                            <li>
                             <table align="left" width="900px"> 
                                <tr>
                                   <td align="right" style="width:25%">
                                        จำนวนผู้มีสิทธิ์เข้ารับการอบรม :
                                    </td>
                                    
                                    <td align="left">
                                        <asp:Label ID="lbAccepTrainee" runat="server" ForeColor="Blue"></asp:Label>&#160;&#160;คน
                                    </td>
                                </tr>
                                </table>
                            </li>
                            <li>
                              <table align="left" width="900px"> 
                                <tr>
                                   <td align="right" style="width:25%">
                                        ค่าใช้จ่ายประมาณในการอบรม :
                                    </td>
                                   <td align="left">
                                        <asp:Label ID="lbTotalPrice" runat="server" ForeColor="Blue"></asp:Label>&#160;&#160;บาท
                                    </td>
                                </tr>
                                </table>
                            </li>
                            <li>
                             <table align="left" width="900px"> 
                                <tr>
                                   <td align="right" style="width:25%">
                                            สถานที่ของการอบรม :
                                        </td>
                                        <td align="left">
                                            <asp:Label ID="lbSchedule" runat="server" ForeColor="Blue"></asp:Label>
                                        </td>
                                   </tr>
                                </table>
                            </li> 
                            </ul> 
                            <table style="width: 646px">
                            <tr>                                    
                            <td align="right" style="width: 321px">
                                <asp:Button ID="btnSave2" onclick="btnSave2_Click" runat="server" CssClass="button" Text="ส่งใบสมัคร" Width="80px"/>   
                                </td>
                            <td align="left">
                                <asp:Button ID="btnCancel2" OnClick="btnCancel2_Click" runat="server" CssClass="button" Text="ยกเลิก" Width="80px" CausesValidation="false" />
                            </td>
                            </tr>
                            </table>
                        
                    </asp:Panel>
        </td>    
        </tr>            
        </table> 
        </div>
        </div>          
        </td>                                             
        </tr>         
    </table>
    </asp:Panel>
    
    <telerik:RadWindowManager ID="RadWindowManager1" VisibleStatusbar="false" ReloadOnShow="true"
        runat="server" Skin="Vista">
        <Windows>
        <telerik:RadWindow 
            id="RadWindow1" 
            runat="server"        
            showcontentduringload="false"
            VisibleStatusbar="false"
            AutoSize = "true"
            title="สมัครเข้ารับการอบรม"      
            Modal="true"
            behaviors="Close">
        </telerik:RadWindow>
    </Windows>        
    </telerik:RadWindowManager> 

</asp:Content>
